package com.refactoring.demo.chapter01.price;

import com.refactoring.demo.chapter01.Movie;

/**
 * @作者：刘富国
 * @创建时间：2018/4/26 14:18
 */
public class RegularPrice extends Price {
    @Override
    int getPriceCode() {
        return Movie.REGULAR;
    }
    @Override
    public double getCharge(Integer daysRented) {
        double result = 2;
        if (daysRented > 2)
            result += (daysRented - 2) * 1.5;
        return result;
    }
}
